﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using KAImage;
using KAImage.Config;

namespace IPCPhotoEditor
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            LoadConfig();
            Application.Run(new FormWorkBench());
        }

        private static void LoadConfig()
        {
            ConfigFiles.Initialize();
            ConfigService service = ConfigService.GetInstance();
            if (!service.CheckLoadAllSuccess())
            {
                string[] errArray = service.GetLoadErrors();
                string title = "部分参数加载异常，详细异常信息如下:";
                FormErrorMessage form = new FormErrorMessage(title, errArray);
                form.ShowDialog();
            }
        }
    }
}
